# -*- coding: utf-8 -*-
#Autor: Vitor Letras n.º 3947

# Testes com excepçoes e diferentes tipos de erro.

try:
    file = open('teste')
except IOError:

    print "Nao existe"

try:
    40/0
except ZeroDivisionError:

    print "Not possible"

#EXemplo Finally    

def divide(x, y):
     try:
         result = x / y
     except ZeroDivisionError:
        print "division by zero!"
     else:
         print "result is", result
     finally:
         print "executing finally clause"
